<%--
  Created by IntelliJ IDEA.
  User: linzichun
  Date: 2023/2/21
  Time: 14:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

    <title>Baidu Map </title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=Z5Vr33fPmw6GDCDGWK8j1H9rvKbBaY7N"></script>
    <style >
        body{
            margin:0px;
            padding:0px;
        }
        #container{
            height:500px;
            width: 900px;

        }
    </style>

</head>
<body>

<div id="container"></div>

</body>
</html>
<script>
    var map= new BMapGL.Map("container");
    var point = new BMapGL.Point(104.066397,30.579377);
    map.centerAndZoom(point, 30);

    var marker = new BMapGL.Marker(point);
    map.addOverlay(marker);
    // 创建信息窗口
    var opts = {
        width: 200,
        height: 100,
        title: '万息科技',
        message:'集训'
    };
    var infoWindow = new BMapGL.InfoWindow('地址：武侯区孵化园9号楼E座', opts);

    //开启鼠标滚轮缩放
    map.enableScrollWheelZoom(true);
    // 点标记添加点击事件

    map.openInfoWindow(infoWindow,map.getCenter());
    marker.addEventListener('click', function () {
        map.openInfoWindow(infoWindow, point); // 开启信息窗口
    });

</script>
